home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Gigarom 1
/
Gigarom Macintosh Archives (Quantum Leap)(CDRM1080320)(1993).iso
/
FILES
/
DEV
/
A-B
/
607+gest.cpt
/
SoundInput.h
< prev
next >
Wrap
Text File
|
1990-10-17
|
8KB
|
228 lines
/*
/* Soundinput.h for system 6.0.6
*
* Copyright (c) 1990 Symantec Corporation. All rights reserved.
*
* These interfaces are based on material copyrighted
* by Apple Computer, Inc., 1985-1990.
*
* Written 10/10/90 MYG based on the MPW soundinput.h
*
*/
#ifndef _SoundInput_
#define _SoundInput_
#ifndef _MacTypes_
#include <MacTypes.h>
#endif
/* Error codes */
enum {
siUnknownQuality = -232, /* invalid quality selector (returned by driver) */
siUnknownInfoType, /* invalid info type selector (returned by driver) */
siInputDeviceErr, /* input device hardware failure */
siBadRefNum, /* invalid input device reference number */
siBadDeviceName, /* input device could not be opened */
siDeviceBusyErr, /* input device already in use */
siInvalidSampleSize, /* invalid sample size */
siInvalidSampleRate, /* invalid sample rate */
siHardDriveTooSlow, /* hard drive too slow to record to disk */
siInvalidCompression, /* invalid compression type */
siNoBufferSpecified, /* returned by synchronous SPBRecord if nil buffer passed */
siBadSoundInDevice, /* invalid index passed to SoundInGetIndexedDevice */
siNoSoundInHardware /* ••• not used anywhere */
};
#define siDeviceIsConnected 1 /* input device is connected and ready forinput */
#define siDeviceNotConnected 0 /* input device is not connected */
#define siDontKnowIfConnected -1 /* can't tell if input device is connected*/
#define siReadPermission 0 /* permission passed to SPBOpenDevice */
#define siWritePermission 1 /* permission passed to SPBOpenDevice */
/* Info Selectors for Sound Input Drivers */
#define siDeviceConnected 'dcon' /* input device connection status */
#define siRTFOnOff 'rtf ' /* record to file state */
#define siAGCOnOff 'agc ' /* automatic gain control state */
#define siPlayThruOnOff 'plth' /* playthrough state */
#define siTwosComplementOnOff 'twos' /* two's complement state */
#define siLevelMeterOnOff 'lmet' /* level meter state */
#define siPauseRecording 'paus' /* recording paused state */
#define siRecordingQuality 'qual' /* recording quality */
#define siVoxRecordInfo 'voxr' /* VOX record parameters */
#define siVoxStopInfo 'voxs' /* VOX stop parameters */
#define siNumberChannels 'chan' /* current number of channels */
#define siSampleSize 'ssiz' /* current sample size */
#define siSampleRate 'srat' /* current sample rate */
#define siCompressionType 'comp' /* current compression type */
#define siCompressionFactor 'cmfa' /* current compression factor */
#define siCompressionHeader 'cmhd' /* return compression header */
#define siUserInterruptProc 'user' /* user interrupt routine */
#define siDeviceName 'name' /* input device name */
#define siDeviceIcon 'icon' /* input device icon */
#define siDeviceBufferInfo 'dbin' /* size of interrupt buffer */
#define siSampleSizeAvailable 'ssav' /* sample sizes available */
#define siSampleRateAvailable 'srav' /* sample rates available */
#define siCompressionAvailable 'cmav' /* compression types available */
#define siChannelAvailable 'chav' /* number of channels available */
#define siInitializeDriver 'init' /* initialize driver */
#define siCloseDriver 'clos' /* close driver */
#define siAsync 'asyn' /* asynchronous capability */
#define siOptionsDialog 'optd' /* display options dialog */
/* Qualities */
#define siBestQuality 'best'
#define siBetterQuality 'betr'
#define siGoodQuality 'good'
/* Sound Input Parameter Block */
typedef struct {
long inRefNum; /* reference number of sound input device */
unsigned long count; /* number of bytes to record */
unsigned long milliseconds; /* number of milliseconds to record */
unsigned long bufferLength; /* length of buffer in bytes */
Ptr bufferPtr; /* buffer to store sound data in */
ProcPtr completionRoutine; /* completion routine */
ProcPtr interruptRoutine; /* interrupt routine */
long userLong; /* user-defined field */
OSErr error; /* error */
long unused1; /* reserved - must be zero */
} SPB, *SPBPtr;
/* Function selectors for the Sound Input calls.
High byte = # words of parameters. */
#define siToolNum 20 /* tool number of for SndDispVersion call */
#define siMOVEL 0x203C /* MOVE.L #selector,D0 */
#define siVersion (0*256)+0
#define siSndRecord (8*256)+4
#define siSignInDevice (3*256)+12
#define siSignOutDevice (1*256)+16
#define siGetIndexedDevice (5*256)+20
#define siOpenDevice (5*256)+24
#define siCloseDevice (2*256)+28
#define siRecord (3*256)+32
#define siPauseRecordingR (2*256)+40
#define siResumeRecording (2*256)+44
#define siStopRecording (2*256)+48
#define siGetRecordingStatus (14*256)+52
#define siGetDeviceInfo (6*256)+56
#define siSetDeviceInfo (6*256)+60
#define siMilliSecondsToBytes (4*256)+64
#define siBytesToMilliSeconds (4*256)+68
#define siSetupSndHeader (13*256)+72
#define siSetupAIFFHeader (11*256)+76
/* SPBVersion (0 parameter words) */
pascal unsigned long
SPBVersion(void)
= {siMOVEL,siVersion,siToolNum,0xA800};
/* SndRecord (8 parameter words) */
pascal OSErr
SndRecord(ProcPtr filterProc, Point corner, OSType quality, Handle *sndHandle)
= {siMOVEL,siSndRecord,siToolNum,0xA800};
/* SPBSignInDevice (3 parameter words) */
pascal OSErr
SPBSignInDevice(short deviceRefNum, Str255 deviceName)
= {siMOVEL,siSignInDevice,siToolNum,0xA800};
/* SPBSignOutDevice (1 parameter words) */
pascal OSErr
SPBSignOutDevice(short deviceRefNum)
= {siMOVEL,siSignOutDevice,siToolNum,0xA800};
/* SPBGetIndexedDevice (5 parameter words) */
pascal OSErr
SPBGetIndexedDevice(short count, Str255 deviceName, Handle *deviceIconHandle)
= {siMOVEL,siGetIndexedDevice,siToolNum,0xA800};
/* SPBOpenDevice (5 parameter words) */
pascal OSErr
SPBOpenDevice(Str255 deviceName, short permission, long *inRefNum)
= {siMOVEL,siOpenDevice,siToolNum,0xA800};
/* SPBCloseDevice (2 parameter words) */
pascal OSErr
SPBCloseDevice(long inRefNum)
= {siMOVEL,siCloseDevice,siToolNum,0xA800};
/* SPBRecord (3 parameter words) */
pascal OSErr
SPBRecord(SPBPtr inParamPtr, Boolean asynchFlag)
= {siMOVEL,siRecord,siToolNum,0xA800};
/* SPBPauseRecording (2 parameter words) */
pascal OSErr
SPBPauseRecording(long inRefNum)
= {siMOVEL,siPauseRecordingR,siToolNum,0xA800};
/* SPBResumeRecording (2 parameter words) */
pascal OSErr
SPBResumeRecording(long inRefNum)
= {siMOVEL,siResumeRecording,siToolNum,0xA800};
/* SPBStopRecording (2 parameter words) */
pascal OSErr
SPBStopRecording(long inRefNum)
= {siMOVEL,siStopRecording,siToolNum,0xA800};
/* SPBGetRecordingStatus (14 parameter words) */
pascal OSErr
SPBGetRecordingStatus( long inRefNum,
short *recordingStatus,
short *meterLevel,
unsigned long *totalSamplesToRecord,
unsigned long *numberOfSamplesRecorded,
unsigned long *totalMsecsToRecord,
unsigned long *numberOfMsecsRecorded )
= {siMOVEL,siGetRecordingStatus,siToolNum,0xA800};
/* SPBGetDeviceInfo (6 parameter words) */
pascal OSErr
SPBGetDeviceInfo(long inRefNum, OSType infoType, char *infoData)
= {siMOVEL,siGetDeviceInfo,siToolNum,0xA800};
/* SPBSetDeviceInfo (6 parameter words) */
pascal OSErr
SPBSetDeviceInfo(long inRefNum, OSType infoType, char *infoData)
= {siMOVEL,siSetDeviceInfo,siToolNum,0xA800};
/* SPBMilliSecondsToBytes (4 parameter words) */
pascal OSErr
SPBMilliSecondsToBytes(long inRefNum, long *milliSeconds)
= {siMOVEL,siMilliSecondsToBytes,siToolNum,0xA800};
/* SPBBytesToMilliSeconds (4 parameter words) */
pascal OSErr
SPBBytesToMilliSeconds(long inRefNum, long *byteCount)
= {siMOVEL,siBytesToMilliSeconds,siToolNum,0xA800};
/* SetupSndHeader (13 parameter words) */
pascal OSErr
SetupSndHeader(Handle sndH, short numChannels, Fixed sampleRate,
short sampleSize, OSType compressionType,
short baseNote, unsigned long numBytes, short *headerLen)
= {siMOVEL,siSetupSndHeader,siToolNum,0xA800};
/* SetupAIFFHeader (11 parameter words) */
pascal OSErr
SetupAIFFHeader(short fRefNum, short numChannels, Fixed sampleRate,
short sampleSize, OSType compressionType,
unsigned long numBytes, unsigned long numFrames)
= {siMOVEL,siSetupAIFFHeader,siToolNum,0xA800};
#endif